NMEA AIS Decoder Driver#215
Conversation
|
Coordinating with Jim to field test driver week of 6/1/2026 |
|
6/2/2026 - Jim and I tested driver at his place and everything worked as intended. |
| developer { | ||
| id 'BillBrown341' | ||
| name 'Bill Brown' | ||
| organization 'Botts-inc' |
There was a problem hiding this comment.
Update to GeoRobotix + in the osgi manifest
| @@ -0,0 +1,87 @@ | |||
| package org.sensorhub.impl.sensor.nmeaais; | |||
There was a problem hiding this comment.
Add license header to files
There was a problem hiding this comment.
NmeaAisHandler.java, NmeaAisOutputRawMessages.java, NmeaAisOutputPositionClassB.java, NmeaAisOutputStaticDataClassB.java, NmeaAisOutputAidNavigation.java, MessageIdDescriptions.java, and NmeaAisReportInterface.java are all missing them!
| .definition(SWEHelper.getPropertyUri("DimStarboard"))) | ||
| .addField("epfd", sweFactory.createQuantity() | ||
| .label("Type of EPFD") | ||
| .description("0 = undefined, 1 = GPS, 2 = GLONASS, 3 = Combined GPS/GLONASS, 4 = Loran-C, 5 = Chayka, 6 = Integrated navigation system, 7 = Surveyed, 8 = Galileo, 15 = internal GNSS") |
There was a problem hiding this comment.
Rather than creating a quantity, you could do a category.
dataRecord.addComponent("epfd", fac.createCategory()
.definition(SWEHelper.getPropertyUri("EPFDType"))
.label("EPFD Type")
.description("description of what EPFD is .....")
.addAllowedValues(
"undefined",
"GPS",
"GLONASS",
"GPS/GLONASS",
"Loran-C",
"Chayka",
"Integrated",
"Surveyed",
"Galileo",
"Internal GNSS")
.build());
then when publishing the data just map the integer code to the string using a switch case
There was a problem hiding this comment.
i think you could do that with a few of these fields if u wanted to display the type rather than a quantity make it a catagory
| osgi { | ||
| manifest { | ||
| attributes ('Bundle-Vendor': 'Botts Inc') | ||
| attributes ('Bundle-Activator': 'org.sensorhub.impl.sensor.aisshipxplorer.Activator') |
There was a problem hiding this comment.
the bundle activator points to a different package that doesn't exist in this driver
'Bundle-Activator': 'org.sensorhub.impl.sensor.aisshipxplorer.Activator'
Should be:
'Bundle-Activator': 'org.sensorhub.impl.sensor.nmeaais.Activator'
| .label(OUTPUT_LABEL) | ||
| .description(OUTPUT_DESCRIPTION) | ||
| .definition(OUTPUT_DEFINITION) | ||
| .addField("messageId", sweFactory.createQuantity() |
There was a problem hiding this comment.
Missing the sampleTime field
| .label("Class B Unit Flag") | ||
| .description("0 = Class B SOTDMA unit; 1 = Class B CS unit") | ||
| .definition(SWEHelper.getPropertyUri("UnitFlag"))) | ||
| .addField("displayFlag", sweFactory.createQuantity() |
There was a problem hiding this comment.
i feel like this could be a boolean, ur saying either yes it has it or no it is not equipped. yes/no 0/1 boolean
| .label("Type of EPFD") | ||
| .description("Electronic position fixing device type (type 19 only)") | ||
| .definition(SWEHelper.getPropertyUri("Epfd"))) | ||
| .addField("dte", sweFactory.createQuantity() |
There was a problem hiding this comment.
boolean is available / is not available
| .description(OUTPUT_DESCRIPTION) | ||
| .definition(OUTPUT_DEFINITION) | ||
| .addField("messageId", sweFactory.createQuantity() | ||
| .label("Message Id") |
There was a problem hiding this comment.
I would suggest creating a NmeaAisHelper, there are several duplicated fields across the output classes. This would help reduce repetitiveness and ensure consistency across ur output structure.
You can put the file in the helpers directory
public class NmeaAisHelper extends GeoPosHelper {
public static final String AIS_URI_BASE = "http://sensorml.com/ont/swe/property/ais/";
public Count createMessageId() {
return createCount()
.description("")
.definition(AIS_URI_BASE + "MessageId")
.label("Message Id");
}
// fill in the rest
}
this would make ur outputs cleaner too
public void doInit() {
NmeaAisHelper fac = new NmeaAisHelper();
aisReportRecord = fac.createRecord()
.name(OUTPUT_NAME)
.label(OUTPUT_LABEL)
.description(OUTPUT_DESCRIPTION)
.definition(OUTPUT_DEFINITION)
.addField("sampleTime", fac.createTime().asSamplingTimeIsoUTC())
.addField("messageId", fac.createMessageId())
}
| dataBlock.setIntValue(25, report.getDimStarboard()); | ||
| dataBlock.setIntValue(26, report.getPosType()); | ||
| dataBlock.setIntValue(27, report.getDte()); | ||
| dataBlock.setIntValue(28, report.getModeFlag()); |
There was a problem hiding this comment.
u set getModeFlag twice in the output
| @@ -0,0 +1,7 @@ | |||
| package org.sensorhub.impl.sensor.nmeaais.outputs; | |||
| import dk.dma.ais.message.AisMessage; | |||
| import dk.dma.ais.message.AisPositionMessage; | |||
The purpose of this driver is to decode NMEA AIS messages from a source (UDP, Serial, etc) and translate them into AIS Reports.